<?php
namespace core;

/**
 * 注册树模式
 */
class Register
{
	private static $objects;

	static function set($alias, $object)
	{
		self::$objects[$alias] = $object;
	}

	static function get($alias)
	{
		if (isset(self::$objects[$alias])) {
			return self::$objects[$alias];
		}
		return null;
	}

	static function all()
	{
		return self::$objects;
	}

	function _unset($alias)
	{
		unset(self::$objects[$alias]);
	}
}
